Skip to content

[9.4] [EA] Fix flaky entities_table_grouping: extend @entityStoreSearch timeout (#268217)#268309

Merged
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-268217
May 7, 2026
Merged

[9.4] [EA] Fix flaky entities_table_grouping: extend @entityStoreSearch timeout (#268217)#268309
kibanamachine merged 1 commit into
elastic:9.4from
kibanamachine:backport/9.4/pr-268217

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

…eout (elastic#268217)

## Summary

Fixes intermittent failures in `entities_table_grouping.cy.ts` reported
in:
- elastic#267794
- elastic#267795
- elastic#267828
- elastic#267965

### Root Cause

PR elastic#265125 added `interceptEntityStoreStatus('running')` +
`cy.wait('@entityStoreStatus', { timeout: 20000 })` to every
`beforeEach` to prevent the page from showing
`EntityStoreDisabledEmptyPrompt`. The intent was correct, but after
`@entityStoreStatus` resolves, the page still needs to:

1. React re-render with the new status data
2. Wait for `isSourcererLoading = false` (the sourcerer / data-view
initialization)
3. Mount `EntitiesTableSection`
4. Fire the POST to `/internal/search/ese`

This cascade can easily take **> 5 s** in slow CI environments, while
`cy.wait('@entityStoreSearch')` was left with the default **5 s
timeout** — causing "No request ever occurred" failures.

### Changes

**Option A** — raise the `@entityStoreSearch` timeout to 20 s, matching
`@entityStoreStatus`.

**Option B** — consolidate `cy.wait('@entityStoreStatus')` +
`cy.wait('@entityStoreSearch')` + `waitForGroupingTable()` into a single
`waitForEntityAnalyticsPageReady()` task helper, so the three
`beforeEach` blocks stay DRY and the timeout logic lives in one place.

Both options are implemented together: the helper encapsulates the
correct timeouts and every `beforeEach` now calls
`waitForEntityAnalyticsPageReady()`.

## Test plan

- [ ] Verify `entities_table_grouping.cy.ts` passes locally
- [ ] Check CI on this PR for the three previously-failing suites (Group
by Resolution, Switching grouping)

## Checklist

- [x] No hardcoded waits (`cy.wait(ms)`) introduced
- [x] No `eslint-disable` introduced
- [x] Existing tests unchanged — only `beforeEach` wiring consolidated

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit fd88e7f)
@kibanamachine
Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

cc @MadameSheema

@kibanamachine kibanamachine merged commit 2eae4d2 into elastic:9.4 May 7, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants